﻿<%@ Page Language="C#" MasterPageFile="~/travel-insurance/Travel_Insurance.master"
    AutoEventWireup="true" CodeFile="results.aspx.cs" Inherits="travel_insurance_results"
    Title="Result Quotes of Travel Insurance - CompareXpress Singapore" MaintainScrollPositionOnPostback="true"
    Async="true" %>

<%@ Register Src="~/controls/usrNoJS.ascx" TagName="usrNoJS" TagPrefix="ucNoJS" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/usrPhoneNo.ascx" TagName="usrPhoneNo" TagPrefix="uc1" %>
<%@ Register Src="../controls/usrIdNumber.ascx" TagName="usrIdNumber" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <style type="text/css">
        .modalBackground
        {
            background-color: Gray;
            filter: alpha(opacity=90);
            opacity: 0.8;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="../css/forms_results.css" />
    <link rel="stylesheet" type="text/css" href="../css/button.css" />
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <div class="elements_inner_wrapper">
        <ucNoJS:usrNoJS ID="usrNoJS1" runat="server" />
        <!-- #Include file="../includes/body_loader.inc" -->

        <script type="text/javascript">
            IncreaseProgress(10);
        </script>

        <div id="divContent" style="display: none;">
            <div id="contentBody_full">
                <div class="form_selection" id="divFormSelection" runat="server">
                    <div class="selection_wrap">
                        <span class="fs_lbl">Trip Type : </span>
                        <asp:Label ID="lblTripType" class="fs_lbl_m" runat="server" />
                        <span class="fs_lbl_r">Type of Policy : </span>
                        <asp:Label ID="lblPolicy" class="fs_lbl_m" runat="server" />
                        <span class="fs_lbl_r">Destination : </span>
                        <asp:Label ID="lblDestination" class="fs_lbl_m" runat="server" />
                        <span class="fs_lbl_r">Travel Date : </span>
                        <asp:Label ID="lblTravelDate" runat="server" class="fs_lbl_m" />
                        <span class="fs_lbl_r">No. of Traveller/s : </span>
                        <asp:Label ID="lblTravellers" class="fs_lbl_m" runat="server" />
                    </div>
                    <br />
                </div>
                <div>
                    <ul id="stp_menu">
                        <li class="stp1_r"><a href="#"><span class="stp_r_g">Start Quote</span></a></li>
                        <li class="stp2_r"><a href="#"><span class="active_r">Quote Results</span></a></li>
                        <li class="stp3"><a href="#"><span class="stp_r">Buy Now</span></a></li>
                    </ul>
                </div>
                <div class="seperator">
                </div>

                <script type="text/javascript">
                    IncreaseProgress(20);
                </script>

                <%--   <div style="width: 100%; height: auto; text-align: right; display: none;" id="divHeadingbuydirect"
                    runat="server">
                    <asp:Image ImageUrl="~/images/bg/heading_buydirect.png" runat="server" ID="imgInstantBuy" /></div>
                <div style="height: 34px;">
                    <asp:ImageButton runat="server" ID="imgbtnCompare" OnClientClick="return Validate_Checkbox()"
                        ImageUrl="~/images/button/xl/select-compare_single.png" OnClick="imgbtnCompare_Click" />
                    <img src="/images/banners/exclusive_i.gif" alt="CompareXpress Exclusive" width="506"
                        height="34" />
                </div>
                <div class="seperator_hilite" id="imgdown" runat="server">
                </div>--%>
                <div style="width: 964px;" id="divHeadingbuydirect" runat="server">
                    <img src="../images/banners/exclusive_i.gif" alt="CompareXpress Exclusive" title="Exclusive! You won't find a cheaper package on any other websites" width="506"
                        height="34" />
                    <div class="right">
                        <asp:ImageButton runat="server" ID="imgbtnCompare" OnClientClick="return Validate_Checkbox()"
                            ImageUrl="~/images/button/xl/select-compare_single.png" OnClick="imgbtnCompare_Click"
                            Width="342" Height="34" />
                    </div>
                    <br />
                </div>
                <div class="seperator_hilite_2 right" id="imgdown" runat="server">
                </div>
                <br />
                <asp:GridView ID="gvTravelResult" runat="server" AutoGenerateColumns="False" CellPadding="0"
                    GridLines="None" DataKeyNames="TAInsID" EmptyDataText="<div class='pad_10'><h2>Thank you for using CompareXpress!</h2><span class='font_12'><strong>No matching package for your selection.</strong></span><div class='seperator'></div><div class='seperator'></div>Please click 'BACK' button below to re-run a travel insurance quote.</div>"
                    EmptyDataRowStyle-CssClass="" AllowSorting="True" OnRowDataBound="gvTravelResult_RowDatabound"
                    CssClass="table_results" ShowFooter="true">
                    <Columns>
                        <asp:BoundField DataField="TAInsID" InsertVisible="False" ReadOnly="True" Visible="False">
                            <ItemStyle Width="0px" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Insurer" HeaderStyle-CssClass="title_l">
                            <ItemTemplate>
                                <div>
                                    <asp:Image runat="server" ID="imgCompanyLogo" Width="100px" />
                                </div>
                                <div>
                                    <asp:Label ID="lblInsurerName" runat="server" Text="" />
                                </div>
                            </ItemTemplate>
                            <ItemStyle CssClass="col_l border2pxl_grey border1pxb_grey" />
                        </asp:TemplateField>
                        <%--  <asp:BoundField DataField="AnnualPremium" DataFormatString="{0:c}" HtmlEncode="false"
                            HeaderText="Premium<br /><span class='grid_font'>(w/ GST)</span>" HeaderStyle-CssClass="title_price"
                            ItemStyle-CssClass="colprice border1pxb_grey" />--%>
                        <asp:TemplateField HeaderText="Premium<br /><span class='grid_font'>(w/ GST)</span>"
                            HeaderStyle-CssClass="title_price">
                            <ItemTemplate>
                                <asp:Label ID="lblPremium" runat="server"></asp:Label><span><asp:Image ID="imgPromo" runat="server" Visible="false" ImageAlign="AbsMiddle" /></span>
                            </ItemTemplate>
                            <ItemStyle CssClass="colprice border1pxb_grey" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Learn more" HeaderStyle-CssClass="title_price_m">
                            <ItemTemplate>
                                <asp:Button ID="btnLearnMore" runat="server" CommandName="LearnMore" class="button_buy-now"
                                    onmousedown="this.className = 'button_buy-now_mousedown';" onmouseup="this.className = 'button_buy-now';"
                                    onmouseout="this.className = 'button_buy-now';" />
                            </ItemTemplate>
                            <ItemStyle CssClass="col_r border2pxr_grey border1pxb_grey" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderStyle-CssClass="title_r_select" FooterStyle-CssClass="row_last" HeaderText="Select">
                            <ItemStyle CssClass="col_select_m border2pxr_grey" />
                            <ItemTemplate>
                                <div onmouseover="this.className='col_select_m_hover border2pxr_grey'" onmouseout="this.className='col_select_m border2pxr_grey'"
                                    style="width: 100%; height: 100%; vertical-align: middle;" id="divcbTravel" runat="server">
                                    <div class="pad50pxt">
                                        <asp:CheckBox ID="cbTASelect" runat="server" onclick="if (this.checked) return checkMaxBox(this, id); else boxesChecked--;unCheckBox(id);  " /><asp:Label
                                            runat="server" ID="lblTempId" Visible="false"></asp:Label>
                                    </div>
                                </div>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle />
                    <SelectedRowStyle />
                    <HeaderStyle CssClass="header" />
                    <EditRowStyle />
                    <RowStyle CssClass="row" />
                    <FooterStyle CssClass="row_last" />
                </asp:GridView>
                <div style="width: 964px; text-align: right;">
                    <div id="imgup" runat="server">
                        <img src="/images/form/bg_result-header_colmargin_up.png" alt="" style="padding-right: 29px;" /></div>
                    <div>
                        <asp:ImageButton runat="server" ID="imgbtnCompare2" OnClientClick="return Validate_Checkbox()"
                            ImageUrl="~/images/button/xl/select-compare_single.png" OnClick="imgbtnCompare_Click"
                            Width="342" Height="34" /></div>
                </div>
                <div class="seperator">
                </div>
                <div class="seperator_dashed">
                </div>
                <div class="seperator">
                </div>

                <script type="text/javascript">
                    IncreaseProgress(50);
                </script>

                <div class="seperator">
                </div>
                <div style="padding: 15px; border: 1px solid #d1d1d1; background: #eeeeee; line-height: 35px;">
                    <div class="blacklbl">
                        <h1>
                            Important Notes:</h1>
                    </div>
                    <div class="blacksmall" style="color: #313131">
                        • The premiums listed above is provided by the respective travel insurance providers.<br />
                        • Coverage intended for overseas traveling and not in Singapore. Insured person
                        must be Singaporean or Singapore Permanent Resident only.<br />
                        • Information displayed here is a summary. Please read the actual policy wordings
                        for details of coverage.
                    </div>
                </div>
                <div class="seperator">
                </div>
                <div class="formButtons">
                    <div class="cancel">
                        <span class="button2">
                            <asp:Button runat="server" ID="ibtnBack" onmousedown="this.className = 'button_back_mousedown';"
                                onmouseout="this.className = 'button_back';" CssClass="button_back" OnClientClick="if (Page_ClientValidate('none')){this.removeAttribute('onmouseout'); this.removeAttribute('onmouseup'); this.className = 'button_processing';} return true;"
                                OnClick="ibtnBack_Click" />
                        </span>
                    </div>
                </div>
                <div>
                    <div style="display: none;">
                        <asp:LinkButton runat="server" ID="lnkbtnPopup" Text="click"></asp:LinkButton>
                        <input id="inputProviderId" runat="server" type="hidden" />
                        <input id="inputTAId" runat="server" type="hidden" />
                        <input id="inputPlanType" type="hidden" runat="server" />
                        <input id="inputPlanName" type="hidden" runat="server" />
                        <input id="inputPremium" type="hidden" runat="server" />
                        <input id="inputResultId" type="hidden" runat="server" />
                        <input id="inputNoOfAdult" type="hidden" runat="server" />
                        <input id="inputUserId" type="hidden" />
                    </div>
                    <cc1:ModalPopupExtender ID="mpePopup" runat="server" DropShadow="true" PopupControlID="pnlPopup"
                        BackgroundCssClass="modalBackground" TargetControlID="lnkbtnPopup" CancelControlID="btnClose"
                        BehaviorID="mdlPopupLearnMore">
                    </cc1:ModalPopupExtender>
                    <!-- Learn More Popup | Start -->
                    <asp:Panel ID="pnlPopup" runat="server" Style="display: none; background: white;"
                        Width="595px" Height="420px">
                        <div id="divPopup" style="padding: 10px; padding-top: 0px; height: 430px;">
                            <div style="width: 100%; height: 30px; text-align: right; margin-top: 3px;">
                                <div class="left" style="font-size: 11px; color: #0098cc; padding: 13px 0 0 15px">
                                    <strong>CompareXpress Exclusive</strong>: You won't find a cheaper package on any
                                    other websites!</div>
                                <div class="bg_grey_5 pad7px txtright" style="width: 560px; text-align: right;">
                                    <a href="#" name="ctl00$ContentPlaceHolder1$btnClose" onclick="HidePanelLearnMore();"
                                        id="A1">
                                        <img src="/images/spacer.gif" id="btnClose" border="0" class="button_close" width="75"
                                            height="30" alt="Close" /></a>
                                </div>
                            </div>
                            <div class="seperator_15px">
                            </div>
                            <div class="seperator_15px">
                            </div>
                            <table cellpadding="0" cellspacing="0" border="0" class="table_details" style="width: 580px;">
                                <tr>
                                    <td width="220">
                                    </td>
                                    <td class="bg_grey_2" width="360">
                                        <div>
                                            <div class="curvetopleft left">
                                            </div>
                                            <div class="curvetopright right">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="txtleft pad7px border1pxdotb_light">
                                        <strong>Your Name</strong>
                                    </td>
                                    <td class="bg_grey_2 pad7px border2pxdotb">
                                        <asp:TextBox ID="txtFullName" Width="250" MaxLength="80" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="rfvFullName" runat="server" ControlToValidate="txtFullName"
                                            CssClass="validationErrorControl" ErrorMessage="" ValidationGroup="travel_insurance"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator ID="revFullName" runat="server" ValidationGroup="travel_insurance"
                                            ValidationExpression="^[a-zA-Z''-'\s]{1,80}$" CssClass="validationErrorControl"
                                            ControlToValidate="txtFullName" ErrorMessage=""></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                 <tr id="trYourTitle" style="display: none;">
                                    <td class="txtleft pad7px border1pxdotb_light">
                                        <strong>Your Title</strong>
                                    </td>
                                    <td class="bg_grey_2 pad7px border2pxdotb">
                                    <asp:DropDownList ID="ddlTitle" runat="server">
                                    <asp:ListItem Value="M">Mr.</asp:ListItem>
                                    <asp:ListItem Value="S">Ms.</asp:ListItem>
                                    <asp:ListItem Value="R">Mrs.</asp:ListItem>
                                    <asp:ListItem Value="D">Dr.</asp:ListItem>
                                    </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="rfvTitle" runat="server" ControlToValidate="ddlTitle"
                                            CssClass="validationErrorControl" ErrorMessage="" ValidationGroup="travel_insurance"></asp:RequiredFieldValidator>                                   
                                    </td>
                                </tr>
                                <tr>
                                    <td class="txtleft pad7px border1pxdotb_light">
                                        <strong>Your E-mail</strong>
                                    </td>
                                    <td class="bg_grey_2 pad7px border2pxdotb">
                                        <asp:TextBox ID="txtEmail" runat="server" Width="250" MaxLength="100"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="rfvEmail" CssClass="validationErrorControl"
                                            runat="server" ValidationGroup="travel_insurance" ErrorMessage="" Text="" ControlToValidate="txtEmail"
                                            Display="Dynamic"></asp:RequiredFieldValidator>
                                        <asp:RegularExpressionValidator CssClass="validationErrorControl" ID="cxvEmail"
                                            runat="server" ValidationGroup="travel_insurance" ErrorMessage="" Text="" ControlToValidate="txtEmail"
                                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="txtleft pad7px border1pxdotb_light">
                                        <strong>Your Mobile Number</strong>
                                    </td>
                                    <td class="bg_grey_2 pad7px border2pxdotb">
                                        <uc1:usrPhoneNo ID="txtMobileNo" IsEnabled="true" IsRequired="true" PhoneNoRequireErrorMessage="Require mobile number."
                                            PhoneNoErrorMessage="Mobile phone number should 8 digits." PhoneNoValidErrorMessage="Invalid mobile phone number."
                                            runat="server" ValidationGroup="travel_insurance" />
                                    </td>
                                </tr>
                                <tr id="trYourNRIC" style="display: none;">
                                    <td class="txtleft pad7px border1pxdotb_light">
                                        <strong>Your NRIC</strong>
                                    </td>
                                    <td class="bg_grey_2 pad7px border2pxdotb">
                                        <uc2:usrIdNumber ID="usrNRIC" runat="server" ValidationGroup="travel_insurance" />
                                    </td>
                                </tr>
                                <tr id="trAdult2Name" style="display: none;">
                                    <td class="txtleft pad7px border1pxdotb_light">
                                        <strong>Adult 2's Name</strong>
                                    </td>
                                    <td class="bg_grey_2 pad7px border2pxdotb">
                                        <asp:TextBox ID="txtAdult2Name" Width="250" MaxLength="80" runat="server" ValidationGroup="travel_insurance"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="rfvInsured2" runat="server" ControlToValidate="txtAdult2Name"
                                            ValidationGroup="travel_insurance" ErrorMessage="" Text="" CssClass="validationErrorControl"></asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="txtleft pad7px">
                                        <strong>Your Preference</strong>
                                    </td>
                                    <td class="bg_grey_2 pad7px">
                                        <asp:Button runat="server" ID="btnBuyNow" CssClass="button_buy-now" OnClick="btnBuyNow_Click"
                                            OnClientClick="LoadValidationErrorCss();return CheckProvider();" ValidationGroup="travel_insurance" />
                                        <div id="divdisclaimer" style="width: 320px; font-size: 0.85em; margin: 0 auto; text-align: justify;
                                            padding: 7px;">
                                        </div>
                                    </td>
                                </tr>
                                <%-- <tr>
                                    <td class="txtleft pad7px" valign="bottom">
                                        
                                    </td>
                                    <td class="bg_grey_2 pad7px">
                                        <asp:Button runat="server" ID="btnEmailMe" ValidationGroup="travel_insurance" CssClass="button_email-me"
                                            OnClick="btnEmailMe_Click" OnClientClick="LoadValidationErrorCss(); return CheckEmailMeProvider();" />
                                    </td>
                                </tr>--%>
                                <tr>
                                    <td class="txtleft pad7px ">
                                        <div style="vertical-align: top;">
                                            <asp:Image ID="imgProvider" runat="server" Width="145px" ImageUrl="~/images/public/logo/liberty.png" />
                                        </div>
                                    </td>
                                    <td class="bg_grey_2 pad7px ">
                                        <span class="bg_grey_2 pad7px">
                                            <asp:Button runat="server" ID="btnEmailThis" CssClass="button_email_m" OnClick="btnEmailThis_Click"
                                                OnClientClick="LoadValidationErrorCss(); return CheckEmailMeProvider();" />
                                        </span>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td class="bg_grey_2 w210px">
                                        <div>
                                            <div class="curvebottomleft left">
                                            </div>
                                            <div class="curvebottomright right">
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td style="font-size:11px;">View CompareXpress! <a href="../terms/" target="_blank">Terms</a> and Comparexpress! <a href="../privacy/" target="_blank">Policy</a>.</td>
                                </tr>
                            </table>
                        </div>
                    </asp:Panel>
                    <!-- Learn More Popup | End   -->
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        window.onload = function() {

            var frm = document.forms[0];

            for (i = 0; i < frm.elements.length; i++) {
                if (frm.elements[i].type == "checkbox") {
                    frm.elements[i].checked = false;
                }
            }

        }
        function Validate_Checkbox() {
            var minCheck = 2;
            var NoOfChecks = 0;
            var chks = document.getElementsByTagName('input');
            //var hasChecked = false;
            for (var i = 0; i < chks.length; i++) {
                if (chks[i].checked) {
                    //hasChecked = true;
                    //break;
                    NoOfChecks++
                }
            }

            //alert(NoOfChecks);
            if (NoOfChecks < minCheck) {

                alert("Please select at least two");

                return false;
            }

        }


        var maxBoxes = 4;
        var boxesChecked = 0;

        function checkMaxBox(theBox, id) {

            if (boxesChecked + 1 > maxBoxes) {
                alert("please select max 4 plans");
                return false;
            }
            boxesChecked++
            /* if (document.getElementById(id).checked == true) {
            var prefid = id.replace(/cbTASelect/, "");
            document.getElementById(prefid + 'divcbTravel').className = 'colchk_checked';
            document.getElementById(prefid + 'divcbTravel').onmouseover = '';
            document.getElementById(prefid + 'divcbTravel').onmouseout = '';

            }*/
            return true;
        }

        function unCheckBox(id) {

            var prefid = id.replace(/cbTASelect/, "");

            /*document.getElementById(prefid + 'divcbTravel').className = '';
            document.getElementById(prefid + 'divcbTravel').onmouseover = function onmouseover(event) { this.className = "colchk_selected"; }
            document.getElementById(prefid + 'divcbTravel').onmouseout = function onmouseover(event) { this.className = "colchk"; }
            */

        }

        function HidePanelLearnMore() {
            document.getElementById('<%=pnlPopup.ClientID%>').style.display = 'none';

            var modpop = $find("mdlPopupLearnMore");
            if (!modpop) { return; }
            modpop.hide();

        }

        function ShowPopupLearnMore(_companyId, _imgurl, _resultid, _annualpremium, _userid, _taid, _planname) {

            document.getElementById('<%=inputProviderId.ClientID %>').value = _companyId;
            document.getElementById('divdisclaimer').style.display = 'none';
            document.getElementById('divPopup').style.height = '385px';
            document.getElementById('<%=pnlPopup.ClientID%>').style.height = '375px';

            document.getElementById('<%=inputResultId.ClientID %>').value = _resultid;
            document.getElementById('<%=inputPremium.ClientID %>').value = _annualpremium;
            document.getElementById('<%=inputTAId.ClientID %>').value = _taid;
            document.getElementById('<%=inputPlanName.ClientID %>').value = _planname;
            document.getElementById('inputUserId').value = _userid;

            document.getElementById('trYourNRIC').style.display = 'none';
            document.getElementById('trAdult2Name').style.display = 'none';
            document.getElementById('trYourTitle').style.display = 'none';
            //alert(_companyId + ',' + _imgurl + ',' + _resultid + ',' + _annualpremium + ', ' + _userid + ', ' + _taid);

            if (_companyId == "23" || _companyId == "34" || _companyId == "37" || _companyId == "38" || _companyId == "24") {
                //hsbc, chinataiping, 1cover, directasia

                document.getElementById('divdisclaimer').style.display = '';
                document.getElementById('divPopup').style.height = '425px';
                document.getElementById('<%=pnlPopup.ClientID%>').style.height = '415px';

                if (_companyId == "23") {
                    document.getElementById('divdisclaimer').innerHTML = "* By clicking Buy Now, you will leave our website to access HSBC's website &amp; accept full responsibility for your own use.";
                }
                else if (_companyId == "34") {
                    document.getElementById('divdisclaimer').innerHTML = "* By clicking Buy Now, you will leave our website to access ChinaTaiping's website &amp; accept full responsibility for your own use.";
                    document.getElementById('trYourNRIC').style.display = '';

                    if (document.getElementById('<%=inputNoOfAdult.ClientID%>').value == '1') {
                        document.getElementById('trAdult2Name').style.display = 'none';

                        document.getElementById('divPopup').style.height = '460px';
                        document.getElementById('<%=pnlPopup.ClientID%>').style.height = '450px';
                    }
                    else {
                        document.getElementById('trAdult2Name').style.display = '';

                        document.getElementById('divPopup').style.height = '500px';
                        document.getElementById('<%=pnlPopup.ClientID%>').style.height = '490px';
                    }                    
                 
                }
                else if (_companyId == "37") {
                    document.getElementById('divdisclaimer').innerHTML = "* By clicking Buy Now, you will leave our website to access 1Cover's website &amp; accept full responsibility for your own use.";
                }
                else if (_companyId == "38") {
                    document.getElementById('divdisclaimer').innerHTML = "* By clicking Buy Now, you will leave our website to access DirectAsia's website &amp; accept full responsibility for your own use.";
                }
                else if (_companyId == "24") {
                    document.getElementById('divdisclaimer').innerHTML = "* By clicking Buy Now, you will leave our website to access RSA's website &amp; accept full responsibility for your own use.";
                    document.getElementById('trYourTitle').style.display = '';
                    document.getElementById('divPopup').style.height = '460px';
                    document.getElementById('<%=pnlPopup.ClientID%>').style.height = '450px';
                }
            }
            document.getElementById('<%=imgProvider.ClientID%>').src = _imgurl;
            var modpop = $find("mdlPopupLearnMore");
            if (!modpop) { return; }
            modpop.show();
        }

        function CallRedirect() {
            companyid = document.getElementById('<%=inputProviderId.ClientID %>').value;
            resultid = document.getElementById('<%=inputResultId.ClientID %>').value;
            annualpremium = document.getElementById('<%=inputPremium.ClientID %>').value;
            userid = document.getElementById('inputUserId').value;
            taid = document.getElementById('<%=inputTAId.ClientID %>').value;
            nric = '';
            ctname2 = '';
            title = '';

            if (companyid == "34") {
                nric_prefix = document.getElementById('<%=usrNRIC.ClientID%>' + '_ddlIdPrefix').value;
                nric_num = document.getElementById('<%=usrNRIC.ClientID%>' + '_txtIdNumber').value;
                nric_suffix = document.getElementById('<%=usrNRIC.ClientID%>' + '_ddlIdPostfix').value;

                nric = nric_prefix + nric_num + nric_suffix;
                ctname2 = document.getElementById('<%=txtAdult2Name.ClientID%>').value;
            }

            if (companyid == "24") {
                title = document.getElementById('<%=ddlTitle.ClientID %>').value;
            }

            var modpop = $find("mdlPopupLearnMore");
            if (!modpop) { return; }
            modpop.hide();

            fullname = document.getElementById('<%=txtFullName.ClientID %>').value;
            mobile = document.getElementById('ctl00_ContentPlaceHolder1_txtMobileNo_txtPhoneNo').value;
            email = document.getElementById('<%=txtEmail.ClientID %>').value;

            window.open('redirect.aspx?resultId=' + resultid + '&providerid=' + companyid + '&premium=' + annualpremium + '&userid=' + userid
            + '&taid=' + taid + '&nric=' + nric + '&name2=' + ctname2 + '&fullname=' + fullname + '&mobile=' + mobile + '&email=' + email + '&title=' + title);

        }

        function CheckProvider() {
            //alert(document.getElementById('divdisclaimer').style.display);

            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdPrefix'), false);
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_rfvIdNumber'), false);
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_revIdNumberLength'), false);
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdNumber'), false);
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdPostfix'), false);
            ValidatorEnable(document.getElementById('<%=rfvInsured2.ClientID%>'), false);
            ValidatorEnable(document.getElementById('<%=rfvTitle.ClientID%>'), false);

            if (document.getElementById('trYourNRIC').style.display == 'none' && document.getElementById('divdisclaimer').style.display == '') {
                if (Page_ClientValidate('travel_insurance')) { CallRedirect(); return false; } else { return false; }
            }
            else if (document.getElementById('trYourNRIC').style.display == '') {
            if (document.getElementById('<%=inputNoOfAdult.ClientID%>').value == '1') {
                    ValidatorEnable(document.getElementById('<%=rfvInsured2.ClientID%>'), false);
                }
                else {
                    ValidatorEnable(document.getElementById('<%=rfvInsured2.ClientID%>'), true);
                }

                ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdPrefix'), true);
                ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_rfvIdNumber'), true);
                ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_revIdNumberLength'), true);
                ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdNumber'), true);
                ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdPostfix'), true);

                if (Page_ClientValidate('travel_insurance')) { CallRedirect(); return false; } else { return false; }
            }
            else if (document.getElementById('trYourTitle').style.display == '') {
                ValidatorEnable(document.getElementById('<%=rfvTitle.ClientID%>'), true);

                if (Page_ClientValidate('travel_insurance')) { CallRedirect(); return false; } else { return false; }
            }
            else {


                if (Page_ClientValidate('travel_insurance')) { return true; }
            }



        }
        function CheckEmailMeProvider() {
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdPrefix'), false);
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_rfvIdNumber'), false);
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_revIdNumberLength'), false);
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdNumber'), false);
            ValidatorEnable(document.getElementById('ctl00_ContentPlaceHolder1_usrNRIC_csvIdPostfix'), false);
            ValidatorEnable(document.getElementById('<%=rfvInsured2.ClientID%>'), false);

            if (Page_ClientValidate('travel_insurance')) { HidePanelLearnMore(); return true; }
        }


        IncreaseProgress(100);
        HideLoading();
        
    </script>

</asp:Content>
